<template>
  <div>
    <h1>大头儿子</h1>
    <button @click="say">大头儿子说</button>
  </div>
</template>

<script>
/* 
$emit自定义事件（子传父）

绑定事件
btn.click = function(){
  console.log('这是个点击事件');
}
触发事件


*/
export default {
  name: "",
  mounted() {
    console.log(this);
    this.$emit("yangyang", "答对了");
  },
  data() {
    return {};
  },

  components: {},

  computed: {},

  beforeMount() {},

  methods: {
    say() {
      // 触发分发事件
      this.$emit("addItem", { name: "lili", age: 10 });
    },
  },

  watch: {},
};
</script>
<style lang='' scoped>
</style>